#include "ObjectView.hpp"
#include <FL/Fl_Tabs.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Value_Output.H>
#include "m3g/m3g.hpp"
#include "constants.hpp"
using namespace m3g;
using namespace m3g_viewer;



ObjectView:: ObjectView (void* obj) : Fl_Window(OBJECT_VIEW_WIDTH,
                                                OBJECT_VIEW_HEIGHT,
                                                "オブジェクト・ビュー")
{
    Fl_Tabs* tabs = new Fl_Tabs (OBJECT_TABS_X,
                                 OBJECT_TABS_Y,
                                 OBJECT_TABS_WIDTH,
                                 OBJECT_TABS_HEIGHT);

    register_m3g_object_tabs ((Object*)obj);

    end ();
}

void regsiter_m3g_Object3D_tab (const Object3D* obj)
{
}

void register_m3g_AnimationController_tab (const AnimationController* ctrl)
{
}

ObjectView::  ~ObjectView ()
{
}


void ObjectView:: register_m3g_object_tabs (m3g::Object* obj)
{
    
    if (Object3D* obj3d = dynamic_cast<Object3D*>(obj)) {
        regsiter_m3g_Object3D_tab (obj3d);
    }
    if (AnimationController* ctrl = dynamic_cast<AnimationController*>(obj)) {
        register_m3g_AnimationController_tab (ctrl);
    }
    if (AnimationTrack* trck = dynamic_cast<AnimationTrack*>(obj)) {
        register_m3g_AnimationTrack_tab (trck);
    }
    if (Appearance* app = dynamic_cast<Appearance*>(obj)) {
        register_m3g_Appearance_tab (app);
    }
    if (Background* bg = dynamic_cast<Background*>(obj)) {
        register_m3g_Background_tab (bg);
    }
    if (CompositingMode* cmode = dynamic_cast<CompositingMode*>(obj)) {
        register_m3g_CompositingMode_tab (cmode);
    }
    if (Fog* fog = dynamic_cast<Fog*>(obj)) {
        register_m3g_Fog_tab (fog);
    }
    if (Image2D* img = dynamic_cast<Image2D*>(obj)) {
        register_m3g_Image2D_tab (img);
    }
    if (IndexBuffer* ibuf = dynamic_cast<IndexBuffer*>(obj)) {
        register_m3g_IndexBuffer_tab (ibuf);
    }
    if (TriangleStripArray* tris = dynamic_cast<TriangleStripArray*>(obj)) {
        register_m3g_TriangleStripArray_tab (tris);
    }
    if (KeyframeSequence* kseq = dynamic_cast<KeyframeSequence*>(obj)) {
        register_m3g_KeyframeSequence_tab (kseq);
    }
    if (Material* mat = dynamic_cast<Material*>(obj)) {
        register_m3g_Material_tab (mat);
    }
    if (PolygonMode* pmode = dynamic_cast<PolygonMode*>(obj)) {
        register_m3g_PolygonMode_tab (pmode);
    }
    if (Transformable* tra = dynamic_cast<Transformable*>(obj)) {
        register_m3g_Transformable_tab (tra);
    }
    if (Node* node = dynamic_cast<Node*>(obj)) {
        register_m3g_Node_tab (node);
    }
    if (Camera* cam = dynamic_cast<Camera*>(obj)) {
        register_m3g_Camera_tab (cam);
    }
    if (Group* grp = dynamic_cast<Group*>(obj)) {
        register_m3g_Group_tab (grp);
    }
    if (World* wld = dynamic_cast<World*>(obj)) {
        register_m3g_World_tab (wld);
    }
    if (Light* lgh = dynamic_cast<Light*>(obj)) {
        register_m3g_Light_tab (lgh);
    }
    if (Mesh* msh = dynamic_cast<Mesh*>(obj)) {
        register_m3g_Mesh_tab (msh);
    }
    if (MorphingMesh* msh = dynamic_cast<MorphingMesh*>(obj)) {
        register_m3g_MorpingMesh_tab (msh);
    }
    if (SkinnedMesh* msh = dynamic_cast<SkinnedMesh*>(obj)) {
        register_m3g_SkinnedMesh_tab (msh);
    }
    if (Sprite3D* spr = dynamic_cast<Sprite3D*>(obj)) {
        register_m3g_Sprite3D_tab (spr);
    }
    if (Texture2D* tex = dynamic_cast<Texture2D*>(obj)) {
        register_m3g_Texture2D_tab (tex);
    }
    if (VertexArray* varry = dynamic_cast<VertexArray*>(obj)) {
        regsiter_m3g_VertexArray_tab (varry);
    }
    if (VertexBuffer* vbuf = dynamic_cast<VertexBuffer*>(obj)) {
        register_m3g_VertexBuffer (vbuf);
    }

}



void ObjectView:: regsiter_m3g_Object3D_tab            (m3g::Object3D* obj3d)
{
/*
    Fl_Group* tab0 = new Fl_Group (20,30,220,180,"タブ0");
    
    Fl_Value_Output* val0 = new Fl_Value_Output (50,40,120,20, "値A：");
    val0->value (1.33);
    Fl_Value_Output* val1 = new Fl_Value_Output (50,60,120,20, "値B：");
    val1->value (1.33);

    tab0->end ();


    Fl_Group* tab1 = new Fl_Group (40,30,140,180,"タブ1");
    tab1->end ();

    Fl_Group* tab2 = new Fl_Group (40,30,140,180,"タブ2");
    tab2->end ();

    Fl_Group* tab3 = new Fl_Group (40,30,140,180,"タブ3");
    tab3->end ();
*/
}

void ObjectView:: register_m3g_AnimationController_tab (m3g::AnimationController* ctrl)
{
}

void ObjectView:: register_m3g_AnimationTrack_tab      (m3g::AnimationTrack* track)
{
}

void ObjectView:: register_m3g_Appearance_tab          (m3g::Appearance* app)
{
}

void ObjectView:: register_m3g_Background_tab          (m3g::Background* bg)
{
}

void ObjectView:: register_m3g_CompositingMode_tab     (m3g::CompositingMode* cmode)
{
}

void ObjectView:: register_m3g_Fog_tab                 (m3g::Fog* fog)
{
}

void ObjectView:: register_m3g_Image2D_tab             (m3g::Image2D* img)
{
}

void ObjectView:: register_m3g_IndexBuffer_tab         (m3g::IndexBuffer* ibuf)
{
}

void ObjectView:: register_m3g_TriangleStripArray_tab  (m3g::TriangleStripArray* tris)
{
}

void ObjectView:: register_m3g_KeyframeSequence_tab    (m3g::KeyframeSequence* kseq)
{
}

void ObjectView:: register_m3g_Material_tab            (m3g::Material* mat)
{
}

void ObjectView:: register_m3g_PolygonMode_tab         (m3g::PolygonMode* pmode)
{
}

void ObjectView:: register_m3g_Transformable_tab       (m3g::Transformable* tra)
{
}

void ObjectView:: register_m3g_Node_tab                (m3g::Node* node)
{
}

void ObjectView:: register_m3g_Camera_tab              (m3g::Camera* cam)
{
}

void ObjectView:: register_m3g_Group_tab               (m3g::Group* grp)
{
}

void ObjectView:: register_m3g_World_tab               (m3g::World* wld)
{
}

void ObjectView:: register_m3g_Light_tab               (m3g::Light* lgh)
{
}

void ObjectView:: register_m3g_Mesh_tab                (m3g::Mesh* msh)
{
}

void ObjectView:: register_m3g_MorpingMesh_tab         (m3g::MorphingMesh* msh)
{
}

void ObjectView:: register_m3g_SkinnedMesh_tab         (m3g::SkinnedMesh* msh)
{
}

void ObjectView:: register_m3g_Sprite3D_tab            (m3g::Sprite3D* spr)
{
}

void ObjectView:: register_m3g_Texture2D_tab           (m3g::Texture2D* tex)
{
}

void ObjectView:: regsiter_m3g_VertexArray_tab         (m3g::VertexArray* varry)
{
}

void ObjectView:: register_m3g_VertexBuffer            (m3g::VertexBuffer* vbuf)
{
}

